package org.abio.XasML.reflect
{
	import flash.utils.getQualifiedClassName;
	
	internal class Factory extends MetadataAware
	{
		public function Factory()
		{
		}

		internal var type:String=null;
		
		internal var extendsClass:Array=new Array();
		internal var implementsInterface:Array=new Array();
		internal var constructor:Array=new Array();
		internal var method:Array=new Array();
		public function get methods():Array{	return this.method;}
		internal var variable:Array=new Array();
		internal var accessor:Array=new Array();
		public function get properties():Array{	return this.variable.concat(this.accessor);}

		public function isType(type:Class):Boolean{
			return (!this.extendsClass.every(function filter(element:Base, index:int, arr:Array):Boolean{
				return !(element.type==getQualifiedClassName(type));
			})) || (!this.implementsInterface.every(function filter(element:Base, index:int, arr:Array):Boolean{
				return !(element.type==getQualifiedClassName(type));
			}));
		}
	}
}